package com.sixkey.utils;

/**
 * ClassName: TimeStringUtils
 * Package: com.sixkey.utils
 * Description:
 *
 * @Author: @weixueshi
 * @Create: 2023/10/10 - 12:55
 * @Version: v1.0
 */

/**
 * 我的会议时间字符串处理
 */
public class TimeStringUtils {

    /**
     * 用于封装创建会议时的数据
     * @param dateTime
     * @param time
     * @return
     */
    public static String getDateTimeString(String dateTime,String time){
        String dateTimeString = dateTime + "~" + time;
        return dateTimeString;
    }

    /**
     * 获取会议开始时间
     * @param beginEndTime
     * @return
     */
    public static String getBeginTime(String beginEndTime){
        String[] split = beginEndTime.split("~");
        String beginTime = split[0];
        return beginTime;
    }

    /**
     * 获取会议室结束时间
     * @param beginEndTime
     * @return
     */
    public static String getEndTime(String beginEndTime){
        String[] split = beginEndTime.split("~");
        String endTime = split[1];
        return endTime;
    }

    /**
     * 获取会议室结束时间
     * @param beginEndTime
     * @return
     */
    public static String getBeginEndTime(String beginEndTime){
        String[] split1 = beginEndTime.split("~");
        String beginTime = split1[0];
        String endTime1 = split1[1];
        String[] split2 = endTime1.split(" ");
        String endTime2 = split2[1];
        String beginEdnTime2 = beginTime + "~" + endTime2;
        return beginEdnTime2;
    }
}
